package cn.blog.controller.front;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.blog.controller.BaseServlet;
import cn.blog.entity.origin.User;
import cn.blog.service.front.CompileHeadService;

@WebServlet("/front/compilehead")
public class Compile_head extends BaseServlet {
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		CompileHeadService chs = new CompileHeadService();
		//获取用户id
		String userId =req.getSession().getAttribute("userId").toString();
		int uid = Integer.parseInt(userId);
		//根据用户编号获取文章信息
		User userInfo  = chs.getUser(uid);
		req.setAttribute("user", userInfo);
		
		forward("front/compilehead");
	}
}
